#!/bim/bash 
var=$(bc<< EOF
var1=3
var2=2
scale=2
var1/var2
EOF
)
echo "$var"

